<!DOCTYPE html>
<html>
<meta http-equiv="X-UA-Compatible" content="IE=7">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<head>
    <title>数据编辑</title>
    <link rel="stylesheet" href="../../static/skins_/css/blue/reset.css" type="text/css" />
    <link rel="stylesheet" href="../../static/skins_/css/blue/global.css" type="text/css" />
    <script src="../../static/loadjs1.js"></script>
</head>
<body>
<!--增加过滤器解决恶意html及None问题-->
<%!
def ESC_BLANK(text):
    if text=="None":
        return ""
    else:
        return text
%>
<%page expression_filter="h,ESC_BLANK"/>
<div class="tool_tab">
    <ul>
        <li class="cur"><a href="#">数据修订</a></li>
    </ul>
</div>
<div class="tool_table">
    <div class="button" onclick="doact()"><a href="#" class="button_gray button_icon_check"><b></b>保存</a></div>
    <div class="button" onclick="window.close()"><a href="#" class="button_gray button_icon_del"><b></b>取消</a></div>

</div>
<table class="table">
    <tbody>
    <tr>
        <td>公司编号：</td><td><input type="text" rel="v" class="u_ipt_inner" value="${i.get("incno","")}"  id="incno" readonly style="background-color:#ffdddd"></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <input type="hidden" rel="v" class="u_ipt_inner"  id="id"></td>
        <td>父级单位：</td><td><input type="text" rel="v" class="u_ipt_inner"  id="parentinc" onClick="selectinc1()" readonly style="background-color:#ddddff" ></td>
         <td>公司类别：</td><td><select rel="v"  id="inctype">
        <optgroup label="公司类别">
        %for d in i.CODES:
            <option value="${d}">${d}</option>
        %endfor
        </optgroup>
        </select></td>
    </tr>
    <tr>
        <td>公司名称：</td><td><input type="text" rel="v" class="u_ipt_inner"  id="incname" ></td>
        <td>详细地址：</td><td><input type="text" rel="v" class="u_ipt_inner"  id="addressdetail"></td>
    </tr>
    <tr>
        <td>邮编：</td><td><input type="text" rel="v" class="u_ipt_inner"  id="postno"></td>
        <td>资金负责人：</td><td><input type="text" rel="v" class="u_ipt_inner"  id="personincharge"></td>
    </tr>
    <tr>
        <td>联系电话：</td><td><input type="text" rel="v" class="u_ipt_inner"  id="phoneno"></td>
        <td>邮件地址：</td><td><input type="text" rel="v" class="u_ipt_inner"  id="emailaddress"></td>
    </tr>
    <tr>

        <td>备注：</td><td colspan="2"><input type="text" rel="v" class="u_ipt_inner"  id="bz1"></td>
    </tr>
    <tr>
    </tr>
    </tbody>
</table>
<div class="tool_table">
    <div class="button" onclick="doact()"><a href="#" class="button_gray button_icon_check"><b></b>保存</a></div>
    <div class="button" onclick="window.close()"><a href="#" class="button_gray button_icon_del"><b></b>取消</a></div>

</div>
<script type="text/javascript" src="/static/skins_/js/settings.js"></script>
<script>
    $(function(){
       %if i.get("rec",None):
        $("#id").val("${i.rec.get("id","")}");
        $("#incno").val("${i.rec.get("incno","")}");
        $("#parentinc").val("${i.rec.get("parentinc","")}");
        $("#incname").val("${i.rec.get("incname","")}");
        $("#addressdetail").val("${i.rec.get("addressdetail","")}");
        $("#postno").val("${i.rec.get("postno","")}");
        $("#personincharge").val("${i.rec.get("personincharge","")}");
        $("#phoneno").val("${i.rec.get("phoneno","")}");
        $("#emailaddress").val("${i.rec.get("emailaddress","")}");
        $("#inctype").val("${i.rec.get("inctype","")}");
        $("#bz1").val("${i.rec.get("bz1","")}");
        %endif
    });

    function doact(){
        var rv={};
        $("[rel='v']").each(function(){
            rv[$(this).attr("id")]=$(this).val();
        });
        rv.status="ok";
        window.returnValue=rv;
        window.close();
    }

    /**
     * 选择公司
     */
    function selectinc1(){
        var v=showModal('/f00/f0099/list?act=inc',480,272);
        $("#parentinc").val(v.incname);
    }

</script>
</body>
</html>